<template>
  <div class="main">
    <div class="car" v-if="totalNum === 0">
      <i class="iconfont icon-ziyuan"></i>
    </div>
    <div class="car2" v-else>
      <i class="iconfont icon-ziyuan"></i>
      <span class="num">{{ totalNum }}</span>
    </div>
    <span class="price" v-if="price != 0">￥{{ price }}</span>
    <div>
      <button v-if="price === 0">￥20起送</button>
      <button v-else-if="price < 20">还差{{ 20 - price }}元起送</button>
      <button class="end" v-else>结算</button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dibug: false,
      cars: [],
    };
  },
  computed: {
    totalNum() {
      return this.$store.getters.total;
    },
    price() {
      return this.$store.getters.price;
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  display: flex;
  justify-content: space-between;
  background-color: #131d27;
  display: flex;
  justify-content: flex-end;
  .price {
    color: red;
    line-height: 60px;
    margin-right: 190px;
  }
  .end {
    background-color: rgb(23, 199, 0);
  }
  button {
    padding: 0 15px;
    height: 60px;
    color: #ccc;
    background-color: #2b343b;
  }
}
.car {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  width: 60px;
  height: 60px;
  border: 10px solid #131d27;
  left: 30px;
  bottom: 10px;
  background-color: #2b343b;
  line-height: 40px;
  text-align: center;
  i {
    color: #7f838a;
    background-color: #2b343b;
    font-size: 25px;
  }
}
.car2 {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 10px solid #131d27;
  border-radius: 50%;
  left: 30px;
  bottom: 10px;
  background-color: #2b343b;
  line-height: 40px;
  text-align: center;
  span {
    background-color: red;
    color: #fff;
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 999;
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    line-height: 20px;
    text-align: center;
  }
  i {
    border-radius: 50%;
    color: #fff;
    background-color: #438dcb;
    padding: 10px;
    font-size: 25px;
  }
}
</style>